import { getS210motorList, getV90motorList } from '@/services/sales/salesNeedInfo';
import {
  PageContainer,
  ProCardTabsProps,
  ProFormInstance,
  ProFormMoney,
} from '@ant-design/pro-components';
import {
  ModalForm,
  ProCard,
  ProFormDependency,
  ProFormDigit,
  ProFormGroup,
  ProFormSelect,
  ProFormText,
  ProForm,
} from '@ant-design/pro-components';
import { Button, Card, Collapse, InputNumber, Select, Space, message } from 'antd';
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
import type { FormDialogProps } from './data';
import type { FormLayout } from 'antd/es/form/Form';
import access from '@/access';
import { useAccess, useLocation } from 'umi';
import { SearchOutlined, SettingFilled } from '@ant-design/icons';
import { getEncoderConfigList } from '@/services/drivepara/encoderConfig';
import { getG120motorByPage, getG120motorList } from '@/services/drivepara/g120motor';
const { Option } = Select;

const LAYOUT_TYPE_HORIZONTAL = 'horizontal';
const G120ShaftEngmodal: React.FC<FormDialogProps> = (props, uploadRef) => {
  const [visible, setVisible] = useState(false);
  const formRef = useRef<ProFormInstance>();
  const [confirmLoading, setConfirmLoading] = useState(false);
  const [collapsed, setCollapsed] = useState(true);
  const [initialValues, setInitialValues] = useState({});
  const [transInitialValues, setTransInitialValues] = useState({});
  const [controlMode, setControlMode] = useState(0);

  const [formLayoutType, setFormLayoutType] = useState<FormLayout>(LAYOUT_TYPE_HORIZONTAL);
  const [grid, setGrid] = useState(true);
  const access = useAccess();
  const [tab, setTab] = useState('');
  const [tabPosition, setTabPosition] = useState<ProCardTabsProps['tabPosition']>('top');
  const location = useLocation();
  const [vmaxEposLu, setVmaxEposLu] = useState(0);
  const [motorParaType, setMotorParaType] = useState(0);

  const [modeHidden, setModeHidden] = useState(true);
  const [eposFlag, setEposFlag] = useState(false);

  const encoderTypeMap = new Map([
    ['3001', '1024HTL A/B R'],
    ['3005', '1024HTL A/B'],
    ['9999', 'User-defined'],
  ]);


  useEffect(() => {
    setVisible(props.visible);
    // props.initialValues.ratedVoltage = 2;
    setInitialValues(props.initialValues || {});
    if (props.initialValues.controlMode === 99) {
      setTab('tab1');
      setModeHidden(false);
    } else if (props.initialValues.controlMode === 21) {
      setTab('tab2');
      setModeHidden(false);
    } else {
      setModeHidden(true);
    }

  }, [props.visible, props.initialValues]);

  useEffect(() => {
    if (location.query.id !== undefined && location.query.id !== null) {
      formRef.current?.setFieldsValue(props.values);
    }
  }, [props.values]);

  useImperativeHandle(uploadRef, () => {
    // return返回的值就可以被父组件获取到,没返回的值就获取不到
    return {
      // 获取其中的值
      getFieldsValue: () => {
        return formRef.current?.getFieldsValue();
      },
      // 设置值
      setFieldsValue: (value: object) => {
        // console.log(formRef.current);
        // debugger;
        return formRef.current?.setFieldsValue({ shaftName: '测试', hardwareIdentifier: 'hhh' });
      },
      // 重置其中的值
      resetFields: () => {
        return formRef.current?.resetFields();
      },
    };
  });

  const g120RowNullData = {
    motorManufacturer: null,
    voltageType: null,
    motorId: null,
    ratedVoltage: null,
    ratedCurrent: null,
    ratedPower: null,
    ratedPowerCoeff: null,
    ratedFrequency: null,
    ratedSpeed: null,
    ratedTorque: null,
    velocityMax: null,
    motorRotation: null,

    motorData1: null,
    motorData2: null,
    motorData3: null,
    motorData4: null,
    motorData5: null,
    motorData6: null,
    motorData7: null,
    motorData8: null,
    motorData9: null,
    motorData10: null,
    motorData11: null,
    motorData12: null,
    motorData13: null,
    motorData14: null,
    motorData15: null,
  };


  const encoderOneRowNullData = {
    encoderManufacturerOne: null,
    encoderTypeOne: null,
    isLinearEncoderOne: null,
    isAbsEncoderOne: null,
    isMultiAbsEncoderOne: null,
    isSsiEncoderOne: null,
    voltageLevelOne: null,
    remoteSenseOne: null,
    signalOne: null,
    levelOne: null,

    gxXist1One: null,
    gxXist2One: null,
    singleCircleResOne: null,
    multiCircleResOne: null,

    transCodeOne: null,
    resolutionOne: null,
    ssiAbsOne: null,
    ssiBeforeOne: null,
    ssiAfterOne: null,
    baudRateOne: null,

    faultBitActiveOne: null,
    faultLevelOne: null,
    faultPosOne: null,
};

  const encoderTwoRowNullData = {
    encoderManufacturerTwo: null,
    encoderTypeTwo: null,
    isLinearEncoderTwo: null,
    isAbsEncoderTwo: null,
    isMultiAbsEncoderTwo: null,
    isSsiEncoderTwo: null,
    voltageLevelTwo: null,
    remoteSenseTwo: null,
    signalTwo: null,
    levelTwo: null,

    gxXist1Two: null,
    gxXist2Two: null,
    singleCircleResTwo: null,
    multiCircleResTwo: null,

    transCodeTwo: null,
    resolutionTwo: null,
    ssiAbsTwo: null,
    ssiBeforeTwo: null,
    ssiAfterTwo: null,
    baudRateTwo: null,

    faultBitActiveTwo: null,
    faultLevelTwo: null,
    faultPosTwo: null,
  };


  return (
    <div>
      <ModalForm
        title={props.title}
        visible={visible}
        formRef={formRef}
        initialValues={initialValues}
        onFinish={async () => {
          setConfirmLoading(true);
          await props.onOk();
          setConfirmLoading(false);
          return true;
        }}
        onValuesChange={(changeValues) => {
          console.log(transInitialValues, "---transInitialValues---");
          console.log(changeValues, "---changeValues---");
          if (changeValues.controlMode != null && changeValues != undefined) {
            if (changeValues.controlMode === 99) {
              setTab('tab1');
              setModeHidden(false);
              setEposFlag(true);
            } else if (changeValues.controlMode === 21) {
              setTab('tab2');
              setModeHidden(false);
              setEposFlag(false);
            } else {
              setModeHidden(true);
            }
          }
        }}
        modalProps={{
          destroyOnClose: true,
          bodyStyle: { height: 500, overflowY: 'scroll' },
          onCancel: () => props.onCancel(),
        }}
        layout={formLayoutType}
        grid={grid}
        rowProps={{
          gutter: [16, formLayoutType === 'inline' ? 16 : 0],
        }}
      >
        <ProFormGroup
          key="lib0"
          title="必填项"
          titleStyle={{ backgroundColor: '#00FA9A' }}
          collapsible
        >
          <ProFormText
            width="md"
            name="shaftName"
            label="轴名称"
            colProps={{ md: 12, xl: 6 }}
            rules={[{ required: true, message: '请输入信息' }]}
          />
          <ProFormDigit
            width="md"
            colProps={{ md: 12, xl: 9 }}
            name="vmaxEpos"
            label="最大速度[m/min]"
            rules={[{ required: true, message: '请输入信息' }]}
          />
          <ProFormDigit
            width="md"
            colProps={{ md: 12, xl: 9 }}
            name="accmaxEpos"
            label="最大加速度[m/s²]"
            rules={[{ required: true, message: '请输入信息' }]}
          />
          <ProFormDigit
            width="md"
            colProps={{ md: 12, xl: 8 }}
            name="gearRationMotor"
            label="齿轮比-电机转数"
            rules={[{ required: true, message: '请输入信息' }]}
          />
          <ProFormDigit
            width="md"
            colProps={{ md: 12, xl: 8 }}
            name="gearRationLoad"
            label="齿轮比-负载转数"
            rules={[{ required: true, message: '请输入信息' }]}
          />
          <ProFormSelect
            width="md"
            name="driveType"
            label="驱动类型"
            options={[
              { label: 'No Selection', value: 0 },
              { label: 'V90PN', value: 10 },
              { label: 'S210', value: 20 },
              { label: 'G120', value: 30 },
              { label: 'S120-SERVO', value: 40 },
              { label: 'S120-VECTOR', value: 41 },
              { label: 'G120C', value: 51 },
            ]}
            colProps={{ md: 12, xl: 8 }}
            hidden={props.isG120Eng}
            rules={[{ required: true, message: '请输入信息' }]}
          />
          <ProFormSelect
            width="md"
            name="controlMode"
            label="控制模式 P1300"
            colProps={{ md: 12, xl: 10 }}
            options={[
              { label: 'V/F', value: 0 },
              { label: '无编码器矢量', value: 20 },
              { label: '编码器速度模式', value: 21 },
              { label: '基本定位模式', value: 99 },
            ]}
            rules={[{ required: true, message: '请输入信息' }]}
          />
          <ProFormDigit
            width="md"
            colProps={{ md: 12, xl: 10 }}
            name="loadOneTurnDistance"
            label="负载一圈的距离 [mm]"
            rules={[{ required: true, message: '请输入信息' }]}
          />

          <ProFormGroup
            title="电机选择"
          >
            <ProFormSelect
              width="md"
              name="connectionType"
              label="连接类型 P133.0"
              colProps={{ md: 12, xl: 6 }}
              options={[
                { label: 'Y', value: 0 },
                { label: 'Δ', value: 1 },
              ]}
              rules={[{ required: true, message: '此项是必填项目' }]}
            />
            <ProFormSelect
              width="md"
              name="is87Hz"
              label="87Hz运行选择 P133.1"
              colProps={{ md: 12, xl: 8 }}
              options={[
                { label: '50Hz', value: 0 },
                { label: '87Hz', value: 1 },
              ]}
              rules={[{ required: true, message: '此项是必填项目' }]}
            />
            <ProFormSelect
              width="md"
              name="motorOrderNum"
              label="电机订货号"
              colProps={{ md: 12, xl: 10 }}
              showSearch
              debounceTime={1000}
              request={async (params) => {
                const result = await getG120motorList({
                  blurry: params.keyWords,
                });
                console.log(params, "---getG120motorList---");
                result.data.push({ motorOrderNum: '第三方', id: '第三方' });
                return result.data.map((item) => {
                  return {
                    key: item.id,
                    label: item.motorOrderNum,
                    value: item.motorOrderNum,
                    // rowData: item,
                  };
                });
              }}
              fieldProps={{
                onChange: (val, child) => {
                  // console.log(child.rowData, '--rowData.id--');
                  // delete child.rowData.id;

                  // formRef.current?.setFieldsValue({
                  //   ...g120RowNullData,
                  //   ...child.rowData,
                  // });
                },
              }}
              rules={[{ required: true, message: '此项是必填项目' }]}
            />
          </ProFormGroup>

          <ProFormDependency name={['controlMode']}>
            {({ controlMode }) => {
              if (controlMode === 99 || controlMode === 21) {
                return [
                  <ProFormGroup
                    title="编码器1配置"
                  >
                    <ProFormSelect
                      width="md"
                      name="encoderNumOne"
                      label="编码器型号"
                      colProps={{ md: 12, xl: 10 }}
                      debounceTime={1000}
                      request={async (params) => {
                        const result = await getEncoderConfigList({ blurry: params.keyWords });
                        result.data.push({ encoderType: '第三方', id: '第三方' });
                        return result.data.map((item) => {
                          return {
                            key: item.id,
                            label: item.encoderNum,
                            value: item.encoderNum,
                            rowData: item,
                          };
                        });
                      }}
                      fieldProps={{
                        onChange: (val, child) => {
                          console.log(child.rowData, '--rowData.id--');
                          delete child.rowData.id;
                          formRef.current?.setFieldsValue({
                            ...encoderOneRowNullData,
                            encoderManufacturerOne: child.rowData.encoderManufacturer,
                            encoderTypeOne: child.rowData.encoderType,
                            isLinearEncoderOne: child.rowData.isLinearEncoder,
                            isAbsEncoderOne: child.rowData.isAbsEncoder,
                            isMultiAbsEncoderOne: child.rowData.isMultiAbsEncoder,
                            isSsiEncoderOne: child.rowData.isSsiEncoder,
                            voltageLevelOne: child.rowData.voltageLevel,
                            remoteSenseOne: child.rowData.remoteSense,
                            signalOne: child.rowData.signal,
                            levelOne: child.rowData.level,
        
                            gxXist1One: child.rowData.gxXist1,
                            gxXist2One: child.rowData.gxXist2,
                            singleCircleResOne: child.rowData.singleCircleRes,
                            multiCircleResOne: child.rowData.multiCircleRes,
        
                            transCodeOne: child.rowData.transCode,
                            resolutionOne: child.rowData.resolution,
                            ssiAbsOne: child.rowData.ssiAbs,
                            ssiBeforeOne: child.rowData.ssiBefore,
                            ssiAfterOne: child.rowData.ssiAfter,
                            baudRateOne: child.rowData.baudRate,
        
                            faultBitActiveOne: child.rowData.faultBitActive,
                            faultLevelOne: child.rowData.faultLevel,
                            faultPosOne: child.rowData.faultPos,
                          });
                        },
                      }}
                      rules={[{ required: true, message: '此项是必填项目' }]}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoder1Interface"
                      label="编码器接口 P468[0]"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'Terminal', value: 1 },
                        { label: 'D-SUB', value: 2 },
                      ]}
                      hidden={props.isG120Eng}
                      rules={[{ required: true, message: '此项是必填项目' }]}
                    />
                    {/* <ProFormDigit
                      colProps={{ md: 12, xl: 8 }}
                      width="md"
                      key="encoder1Revolution"
                      name="encoder1Revolution"
                      label="编码器转数"
                      rules={[{ required: true, message: '此项是必填项目' }]}
                    />
                    <ProFormDigit
                      colProps={{ md: 12, xl: 8 }}
                      width="md"
                      key="motor1Revolution"
                      name="motor1Revolution"
                      label="电机转数"
                      rules={[{ required: true, message: '此项是必填项目' }]}
                    /> */}
                  </ProFormGroup>
                ];
              }
            }}
          </ProFormDependency>

          <ProFormDependency name={['controlMode']}>
            {({ controlMode }) => {
              if (controlMode === 99) {
                return [
                  <ProFormGroup
                    title="编码器2配置"
                  >
                    <ProFormGroup>
                      <ProFormSelect
                        width="md"
                        name="isEncoder2Selected"
                        label="编码器2选择"
                        colProps={{ md: 12, xl: 8 }}
                        options={[
                          { label: '编码器2未选择', value: 0 },
                          { label: '编码器2已选择', value: 1 },
                        ]}
                        rules={[{ required: true, message: '此项是必填项目' }]}
                      />
                    </ProFormGroup>
                    <ProFormDependency name={['isEncoder2Selected']}>
                      {({ isEncoder2Selected }) => {
                        if (isEncoder2Selected === 1) {
                          return [
                            <ProFormGroup>
                              <ProFormSelect
                                width="md"
                                name="encoder2Interface"
                                label="编码器接口 P468[1]"
                                colProps={{ md: 12, xl: 10 }}
                                options={[
                                  { label: 'Terminal', value: 1 },
                                  { label: 'D-SUB', value: 2 },
                                ]}
                                hidden={props.isG120Eng}
                                rules={[{ required: true, message: '此项是必填项目' }]}
                              />
                              {/* <ProFormDigit
                                colProps={{ md: 12, xl: 8 }}
                                width="md"
                                key="encoder2Revolution"
                                name="encoder2Revolution"
                                label="编码器转数"
                                rules={[{ required: true, message: '此项是必填项目' }]}
                              />
                              <ProFormDigit
                                colProps={{ md: 12, xl: 8 }}
                                width="md"
                                key="motor2Revolution"
                                name="motor2Revolution"
                                label="电机转数"
                                rules={[{ required: true, message: '此项是必填项目' }]}
                              /> */}
                              <ProFormSelect
                                width="md"
                                name="encoderNumTwo"
                                label="编码器类型"
                                colProps={{ md: 12, xl: 10 }}
                                debounceTime={1000}
                                request={async (params) => {
                                  const result = await getEncoderConfigList({ blurry: params.keyWords });
                                  result.data.push({ encoderType: '第三方', id: '第三方' });
                                  return result.data.map((item) => {
                                    return {
                                      key: item.id,
                                      label: item.encoderNum,
                                      value: item.encoderNum,
                                      rowData: item,
                                    };
                                  });
                                }}
                                fieldProps={{
                                  onChange: (val, child) => {
                                    console.log(child.rowData, '--rowData.id--');
                                    delete child.rowData.id;
                                    formRef.current?.setFieldsValue({
                                      ...encoderTwoRowNullData,
                                      encoderManufacturerTwo: child.rowData.encoderManufacturer,
                                      encoderTypeTwo: child.rowData.encoderType,
                                      isLinearEncoderTwo: child.rowData.isLinearEncoder,
                                      isAbsEncoderTwo: child.rowData.isAbsEncoder,
                                      isMultiAbsEncoderTwo: child.rowData.isMultiAbsEncoder,
                                      isSsiEncoderTwo: child.rowData.isSsiEncoder,
                                      voltageLevelTwo: child.rowData.voltageLevel,
                                      remoteSenseTwo: child.rowData.remoteSense,
                                      signalTwo: child.rowData.signal,
                                      levelTwo: child.rowData.level,
        
                                      gxXist1Two: child.rowData.gxXist1,
                                      gxXist2Two: child.rowData.gxXist2,
                                      singleCircleResTwo: child.rowData.singleCircleRes,
                                      multiCircleResTwo: child.rowData.multiCircleRes,
        
                                      transCodeTwo: child.rowData.transCode,
                                      resolutionTwo: child.rowData.resolution,
                                      ssiAbsTwo: child.rowData.ssiAbs,
                                      ssiBeforeTwo: child.rowData.ssiBefore,
                                      ssiAfterTwo: child.rowData.ssiAfter,
                                      baudRateTwo: child.rowData.baudRate,
        
                                      faultBitActiveTwo: child.rowData.faultBitActive,
                                      faultLevelTwo: child.rowData.faultLevel,
                                      faultPosTwo: child.rowData.faultPos,
                                    });
                                  },
                                }}
                                rules={[{ required: true, message: '此项是必填项目' }]}
                              />
                            </ProFormGroup>
                          ];
                        } else {}
                      }}
                    </ProFormDependency>
                  </ProFormGroup>
                ];
              }
            }}
          </ProFormDependency>

          <ProFormDependency name={['controlMode']}>
            {({ controlMode }) => {
              if (controlMode === 99) {
                return [
                  <ProFormGroup>
                    <ProFormSelect
                      width="md"
                      colProps={{ md: 12, xl: 8 }}
                      name="lrEncoderAssign"
                      label="定位编码器 P2502"
                      options={[
                        { label: 1, value: 1 },
                        { label: 2, value: 2 },
                      ]}        
                      rules={[{ required: true, message: '此项是必填项目' }]}
                    />
                  </ProFormGroup>
                ];
              } else {}
            }}
          </ProFormDependency>
        </ProFormGroup>

        <ProFormGroup
          key="lib1"
          title="基础信息配置"
          titleStyle={{ backgroundColor: '#f0f0f0' }}
          collapsible
          // defaultCollapsed
        >
          <ProFormText hidden={true} name="id" label="轴信息Id" />
          <ProFormSelect
            width="md"
            name="isDriveSelected"
            label="驱动选择"
            options={[
              { label: 'FALSE', value: 0 },
              { label: 'TRUE', value: 1 },
            ]}
            colProps={{ md: 12, xl: 8 }}
            hidden={props.isG120Eng}
          />
          <ProFormText
            width="md"
            name="shaftName"
            label="轴名称"
            colProps={{ md: 12, xl: 8 }}
            disabled
          />
          <ProFormSelect
            width="md"
            name="loadType"
            colProps={{ md: 12, xl: 8 }}
            label="负载类型"
            options={[
              { label: '水平', value: 1 },
              { label: '旋转', value: 2 },
              { label: '垂直', value: 3 },
              { label: '斜坡', value: 4 },
              { label: '其它', value: 5 },
            ]}
            hidden={props.isG120Calc}
          />
          <ProFormSelect
            width="md"
            name="mechanicalStructure"
            label="机械结构"
            colProps={{ md: 12, xl: 8 }}
            options={[
              { label: '丝杠', value: 1 },
              { label: '齿轮齿条', value: 2 },
              { label: '皮带轮', value: 3 },
              { label: '圆盘', value: 4 },
              { label: '辊式带', value: 5 },
              { label: '链条', value: 6 },
            ]}
            hidden={props.isG120Calc}
          />
          <ProFormSelect
            width="md"
            name="driveType"
            label="驱动类型"
            options={[
              { label: 'No Selection', value: 0 },
              { label: 'V90PN', value: 10 },
              { label: 'S210', value: 20 },
              { label: 'G120', value: 30 },
              { label: 'S120-SERVO', value: 40 },
              { label: 'S120-VECTOR', value: 41 },
              { label: 'G120C', value: 51 },
            ]}
            colProps={{ md: 12, xl: 8 }}
            hidden={props.isG120Eng}
            disabled
          />
          <ProFormDigit
            width="md"
            colProps={{ md: 12, xl: 8 }}
            name="cuHardwareIdentifier"
            label="控制单元硬件标识符"
            hidden={props.isG120Eng}
          />
          <ProFormDigit
            width="md"
            colProps={{ md: 12, xl: 8 }}
            name="hardwareIdentifier"
            label="硬件标识符"
            hidden={props.isG120Eng}
          />
          <ProFormText
            width="md"
            name="driveShaftNum"
            label="驱动轴号"
            colProps={{ md: 12, xl: 8 }}
            hidden={props.isG120Eng}
          />
          <ProFormSelect
            width="md"
            name="isSlaveSelected"
            label="从轴选择"
            options={[
              { label: '非从轴', value: 0 },
              { label: '从轴', value: 1 },
            ]}
            colProps={{ md: 12, xl: 8 }}
            hidden={props.isG120Eng}
          />
          <ProFormDigit
            width="md"
            name="ddsNum"
            label="驱动数据组数量"
            colProps={{ md: 12, xl: 8 }}
            hidden={props.isG120Eng}
          />
        </ProFormGroup>

        <ProFormGroup
          key="lib2"
          title="驱动配置"
          titleStyle={{ backgroundColor: '#f0f0f0' }}
          collapsible
          // defaultCollapsed
        >
          <ProFormGroup>
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="supplyVoltage"
              label="驱动进线电压 P210"
              hidden={props.isG120Eng}
            />
            <ProFormSelect
              width="md"
              name="applicationClass"
              label="驱动应用级 P96"
              options={[
                { label: '专家级', value: 0 },
                { label: 'SDC', value: 1 },
                { label: 'DDC', value: 2 },
              ]}
              colProps={{ md: 12, xl: 8 }}
              hidden={props.isG120Eng}
            />
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="driveDataSetsNum"
              label="驱动数据组数量 P180"
              hidden={props.isG120Eng}
            />
            <ProFormSelect
              width="md"
              name="commTelegram"
              label="控制报文 P922"
              colProps={{ md: 12, xl: 8 }}
              options={[
                { label: '105', value: 105 },
                { label: '111', value: 111 },
                { label: '102', value: 102 },
                { label: '3', value: 3 },
                { label: '1', value: 1 },
              ]}
            />
            <ProFormSelect
              width="md"
              name="additionalTelegram"
              label="附加报文 P8864"
              colProps={{ md: 12, xl: 8 }}
              options={[
                { label: 'None', value: 999 },
                { label: '750', value: 750 },
              ]}
            />
            <ProFormSelect
              width="md"
              name="controlMode"
              label="控制模式 P1300"
              colProps={{ md: 12, xl: 8 }}
              options={[
                { label: 'V/F', value: 0 },
                { label: '无编码器矢量', value: 20 },
                { label: '编码器速度模式', value: 21 },
                { label: '基本定位模式', value: 99 },
              ]}
              disabled
            />
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="currentLimit"
              label="电流限制值 P640 [Arms]"
              hidden={props.isG120Eng}
            />
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="refSpeed"
              label="参考转速 P2000 [rpm]"
              hidden={props.isG120Eng}
            />
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="refCurrent"
              label="参考电流 P2002 [Arms]"
              hidden={props.isG120Eng}
            />
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="refTorque"
              label="参考转矩 P2003 [Nm]"
              hidden={props.isG120Eng}
            />
          </ProFormGroup>
          <ProFormGroup
            key="lib2-1"
            title="转矩限幅值"
            // titleStyle={{ color: 'CornflowerBlue', fontSize: '14px' }}
            collapsible
            // defaultCollapsed
          >
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 10 }}
              name="torqueLimUpper"
              label="转矩限幅上限 P1520 [Nm]"
            />
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 10 }}
              name="torqueLimLower"
              label="转矩限幅下限 P1521 [Nm]"
              min={-100000}
            />
          </ProFormGroup>
          <ProFormGroup
            key="lib2-2"
            title="抱闸配置"
            // titleStyle={{ color: 'CornflowerBlue', fontSize: '14px' }}
            collapsible
            // defaultCollapsed
          >
            <ProFormSelect
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="brakeFromCus"
              label="抱闸"
              options={[
                { label: '没有', value: 0 },
                { label: '有', value: 1 },
              ]}
            />
            <ProFormSelect
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="brake"
              label="抱闸配置 P1215"
              options={[
                { label: '无电机抱闸', value: 0 },
                { label: '电机抱闸同顺序控制', value: 1 },
                { label: '电机抱闸始终打开', value: 2 },
                { label: '电机抱闸同顺序控制，通过 BICO 连接', value: 3 },
              ]}
            />
            <ProFormDigit
              colProps={{ md: 12, xl: 8 }}
              width="md"
              name="tbrakeOpen"
              label="抱闸打开时间 P1216 [ms]"
            />
            <ProFormDigit
              colProps={{ md: 12, xl: 8 }}
              width="md"
              name="tbrakeClose"
              label="抱闸闭合时间 P1217 [ms]"
            />
            <ProFormDigit
              colProps={{ md: 12, xl: 10 }}
              width="md"
              name="brakingPower"
              label="制动电阻制动功率 P219 [kW]"
              hidden={props.isG120Eng}
            />
            <ProFormDigit
              colProps={{ md: 12, xl: 10 }}
              width="md"
              name="regenPowerLimit"
              label="再生方式功率极限 P1531 [kW]"
              hidden={props.isG120Eng}
            />
            <ProFormSelect
              width="md"
              colProps={{ md: 12, xl: 12 }}
              name="brakeCtrlDiag"
              label="制动控制诊断分析 P1278"
              options={[
                { label: '带诊断分析的制动控制', value: 0 },
                { label: '不带诊断分析的制动控制', value: 1 },
              ]}
            />
            <ProFormDigit
              colProps={{ md: 12, xl: 8 }}
              width="md"
              name="brakeStartFrequency"
              label="启动频率 P1351 [%]"
            />
            <ProFormDigit
              colProps={{ md: 12, xl: 8 }}
              width="md"
              name="brakeCtrlDo"
              label="抱闸控制输出DO"
            />
          </ProFormGroup>
        </ProFormGroup>

        <ProFormGroup
          key="lib3"
          title="电机配置"
          titleStyle={{ backgroundColor: '#f0f0f0' }}
          collapsible
          // defaultCollapsed
        >
          <ProFormGroup>
            <ProFormDigit
              width="md"
              colProps={{ md: 12, xl: 8 }}
              name="velocityMax"
              label="最大转速 P1082 [rpm]"
              hidden={props.isG120Eng}
            />
            <ProFormSelect
              width="md"
              name="motorRotation"
              label="电机方向 P1820"
              options={[
                { label: '逆时针', value: 0 },
                { label: '顺时针', value: 1 },
              ]}
              colProps={{ md: 12, xl: 8 }}
              hidden={props.isG120Eng}
            />
          </ProFormGroup>
          <ProFormGroup
            title="电机选择"
          >
            <ProFormSelect
              width="md"
              name="connectionType"
              label="连接类型 P133.0"
              colProps={{ md: 12, xl: 6 }}
              options={[
                { label: 'Y', value: 0 },
                { label: 'Δ', value: 1 },
              ]}
            />
            <ProFormSelect
              width="md"
              name="is87Hz"
              label="87Hz运行选择 P133.1"
              colProps={{ md: 12, xl: 8 }}
              options={[
                { label: '50Hz', value: 0 },
                { label: '87Hz', value: 1 },
              ]}
            />
            <ProFormSelect
              width="md"
              name="motorOrderNum"
              label="电机订货号"
              colProps={{ md: 12, xl: 10 }}
              showSearch
              debounceTime={1000}
              request={async (params) => {
                const result = await getG120motorList({
                  blurry: params.keyWords,
                });
                console.log(params, "---getG120motorList---");
                result.data.push({ motorOrderNum: '第三方', id: '第三方' });
                return result.data.map((item) => {
                  return {
                    key: item.id,
                    label: item.motorOrderNum,
                    value: item.motorOrderNum,
                    // rowData: item,
                  };
                });
              }}
              fieldProps={{
                onChange: (val, child) => {
                  // console.log(child.rowData, '--rowData.id--');
                  // delete child.rowData.id;

                  // formRef.current?.setFieldsValue({
                  //   ...g120RowNullData,
                  //   ...child.rowData,
                  // });
                },
              }}
              // rules={[{ required: true, message: '此项是必填项目' }]}
            />
            <Button
              type="primary"
              icon={<SearchOutlined />}
              onClick={async () => {
                if (formRef.current?.getFieldValue('motorOrderNum') === undefined ||
                  formRef.current?.getFieldValue('connectionType') === undefined ||
                  formRef.current?.getFieldValue('is87Hz') === undefined) {
                  message.error("请先设置匹配项");
                } else {
                  console.log(formRef.current?.getFieldValue('connectionType'), "---");
                  const result = await getG120motorByPage({
                    current: 1,
                    pageSize: 200,
                    connectionType:
                      formRef.current?.getFieldValue('connectionType') !== null ?
                        formRef.current?.getFieldValue('connectionType') : null,
                    is87Hz: formRef.current?.getFieldValue('is87Hz'),
                    motorOrderNum: formRef.current?.getFieldValue('motorOrderNum'),
                  });
                  console.log(result.data.content, "---电机匹配111---");
                  result.data.content.length !== 0 ?
                    result.data.content.map((item) => {
                      delete item.id;
                      formRef.current?.setFieldsValue({
                        ...g120RowNullData,
                        ...item,
                      });
                    }) : 
                    formRef.current?.setFieldsValue({
                      ...g120RowNullData,
                    });
                  result.data.content.length !== 0 ?
                    message.success("匹配成功！") :
                    message.error("匹配失败");
                }
              
              }}
            >
              匹配
            </Button>
          </ProFormGroup>
          <ProFormGroup
            key="lib3-1"
            title="电机信息"
            // titleStyle={{ backgroundColor: '#f0f0f0' }}
            collapsible
            // defaultCollapsed
            onCollapse={(collapse) => console.log(collapse)}
          >
            <ProFormGroup>
              <ProFormText
                width="md"
                name="motorManufacturer"
                label="电机厂家"
                colProps={{ md: 12, xl: 8 }}
                disabled
              />
              <ProFormSelect
                width="md"
                name="voltageType"
                label="电压类型"
                options={[
                  { label: '230/400V Δ/Y', value: 0 },
                  { label: '400/690V Δ/Y', value: 1 },
                ]}
                colProps={{ md: 12, xl: 8 }}
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorId"
                label="电机代码选择 P301"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="ratedVoltage"
                label="额定电压 P304 [V]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="ratedCurrent"
                label="额定电流 P305 [A]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="ratedPower"
                label="额定功率 P307 [kW]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="ratedPowerCoeff"
                label="额定功率因数 P308"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="ratedFrequency"
                label="额定频率 P310 [Hz]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="ratedSpeed"
                label="额定速度 P311 [rpm]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="ratedTorque"
                label="额定转矩 P312 [Nm]"
                disabled
              />
            </ProFormGroup>
            <ProFormGroup
              key="lib3-1-1"
              title="motorData"
              titleStyle={{ color: 'CornflowerBlue', fontSize: '14px' }}
              collapsible
              // defaultCollapsed
            >
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData1"
                label="motorData[1]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData2"
                label="motorData[2]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData3"
                label="motorData[3]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData4"
                label="motorData[4]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData5"
                label="motorData[5]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData6"
                label="motorData[6]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData7"
                label="motorData[7]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData8"
                label="motorData[8]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData9"
                label="motorData[9]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData10"
                label="motorData[10]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData11"
                label="motorData[11]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData12"
                label="motorData[12]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData13"
                label="motorData[13]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData14"
                label="motorData[14]"
                disabled
              />
              <ProFormDigit
                width="md"
                colProps={{ md: 12, xl: 8 }}
                name="motorData15"
                label="motorData[15]"
                disabled
              />
            </ProFormGroup>
          </ProFormGroup>
        </ProFormGroup>

        <ProFormDependency name={['controlMode']}>
          {({ controlMode }) => {
            if (controlMode === 99) {
              return [
                <ProFormGroup
                  key="lib4"
                  title="编码器配置"
                  titleStyle={{ backgroundColor: '#f0f0f0' }}
                  collapsible
                  // defaultCollapsed
                >
                  <ProFormGroup
                    key="lib4-1"
                    title="编码器1配置"
                    titleStyle={{ backgroundColor: '#f0f8ff' }}
                  >
                    <ProFormSelect
                      width="md"
                      name="encoder1Interface"
                      label="编码器接口 P468[0]"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'Terminal', value: 1 },
                        { label: 'D-SUB', value: 2 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormDigit
                      colProps={{ md: 12, xl: 8 }}
                      width="md"
                      key="encoder1Revolution"
                      name="encoder1Revolution"
                      label="编码器转数"
                    />
                    <ProFormDigit
                      colProps={{ md: 12, xl: 8 }}
                      width="md"
                      key="motor1Revolution"
                      name="motor1Revolution"
                      label="电机转数"
                    />
                    <ProFormSelect
                      width="md"
                      name="encoder1InvertSpeed"
                      label="转速实际值取反 P410[0].00"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'FALSE', value: 0 },
                        { label: 'TRUE', value: 1 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoder1InvertPos"
                      label="位置实际值取反 P410[0].01"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'FALSE', value: 0 },
                        { label: 'TRUE', value: 1 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoderNumOne"
                      label="编码器型号"
                      colProps={{ md: 12, xl: 10 }}
                      debounceTime={1000}
                      request={async (params) => {
                        const result = await getEncoderConfigList({ blurry: params.keyWords });
                        result.data.push({ encoderType: '第三方', id: '第三方' });
                        return result.data.map((item) => {
                          return {
                            key: item.id,
                            label: item.encoderNum,
                            value: item.encoderNum,
                            rowData: item,
                          };
                        });
                      }}
                      fieldProps={{
                        onChange: (val, child) => {
                          console.log(child.rowData, '--rowData.id--');
                          delete child.rowData.id;
                          formRef.current?.setFieldsValue({
                            ...encoderOneRowNullData,
                            encoderManufacturerOne: child.rowData.encoderManufacturer,
                            encoderTypeOne: child.rowData.encoderType,
                            isLinearEncoderOne: child.rowData.isLinearEncoder,
                            isAbsEncoderOne: child.rowData.isAbsEncoder,
                            isMultiAbsEncoderOne: child.rowData.isMultiAbsEncoder,
                            isSsiEncoderOne: child.rowData.isSsiEncoder,
                            voltageLevelOne: child.rowData.voltageLevel,
                            remoteSenseOne: child.rowData.remoteSense,
                            signalOne: child.rowData.signal,
                            levelOne: child.rowData.level,
      
                            gxXist1One: child.rowData.gxXist1,
                            gxXist2One: child.rowData.gxXist2,
                            singleCircleResOne: child.rowData.singleCircleRes,
                            multiCircleResOne: child.rowData.multiCircleRes,
      
                            transCodeOne: child.rowData.transCode,
                            resolutionOne: child.rowData.resolution,
                            ssiAbsOne: child.rowData.ssiAbs,
                            ssiBeforeOne: child.rowData.ssiBefore,
                            ssiAfterOne: child.rowData.ssiAfter,
                            baudRateOne: child.rowData.baudRate,
      
                            faultBitActiveOne: child.rowData.faultBitActive,
                            faultLevelOne: child.rowData.faultLevel,
                            faultPosOne: child.rowData.faultPos,
                          });
                        },
                      }}
                      // rules={[{ required: true, message: '此项是必填项目' }]}
                    />
                    <ProFormGroup
                      key="lib4-1-1"
                      title="编码器1信息"
                      // titleStyle={{ backgroundColor: '#f0f0f0' }}
                      collapsible
                      // defaultCollapsed
                      onCollapse={(collapse) => console.log(collapse)}
                    >
                      <ProFormText
                        width="md"
                        name="encoderManufacturerOne"
                        label="编码器厂家"
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="encoderTypeOne"
                        label="编码器类型"
                        options={[
                          { label: '1024HTL A/B R', value: '3001' },
                          { label: '1024HTL A/B', value: '3005' },
                          { label: 'User-defined', value: '9999' },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isLinearEncoderOne"
                        label="线性编码器 P404[0].00"
                        options={[
                          { label: 'Rotary', value: 0 },
                          { label: 'Linear', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isAbsEncoderOne"
                        label="绝对值编码器 P404[0].01"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isMultiAbsEncoderOne"
                        label="多圈绝对值编码器 P404[0].02"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 10 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isSsiEncoderOne"
                        label="SSI编码器 P404[0].09"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 7 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="voltageLevelOne"
                        label="电压级24V P404[0].20/P404[0].21"
                        options={[
                          { label: '5V', value: 0 },
                          { label: '13.5-30V', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 11 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="remoteSenseOne"
                        label="遥感仅对SMC30 P404[0].22"
                        options={[
                          { label: 'Unselect', value: 0 },
                          { label: 'Select', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 10 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="signalOne"
                        label="信号 P405[0].00"
                        options={[
                          { label: 'Unipolar', value: 0 },
                          { label: 'Bipolar', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="levelOne"
                        label="电平 P405[0].01"
                        options={[
                          { label: 'HTL', value: 0 },
                          { label: 'TTL', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
      
      
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gxXist1One"
                        label="编码器精Gx_XIST1 P418[0]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gxXist2One"
                        label="编码器精Gx_XIST2 P419[0]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="singleCircleResOne"
                        label="绝对值编码器单圈 P423[0]/P408[0]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="multiCircleResOne"
                        label="绝对值编码器多圈 P421[0]"
                        disabled
                      />
      
      
                      <ProFormGroup
                        key="lib4-1-1-1"
                        title="SSI编码器配置"
                        titleStyle={{ color: 'CornflowerBlue', fontSize: '14px' }}
                        collapsible
                        // defaultCollapsed
                      >
                        <ProFormSelect
                          width="md"
                          name="transCodeOne"
                          label="传输代码 P429[0].00"
                          options={[
                            { label: '格雷码', value: 0 },
                            { label: '二进制代码', value: 1 },
                          ]}
                          colProps={{ md: 12, xl: 8 }}
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="resolutionOne"
                          label="分辨率 P407[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiAbsOne"
                          label="编码器绝对值位 P447[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiBeforeOne"
                          label="编码器之前的位 P446[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiAfterOne"
                          label="编码器之后的位 P448[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="baudRateOne"
                          label="波特率 P427[0]"
                          disabled
                        />
                    
                        <ProFormGroup
                          key="lib4-1-1-1-1"
                          title="SSI故障位设置"
                          titleStyle={{ color: 'LightSlateGray', fontSize: '14px' }}
                          collapsible
                          // defaultCollapsed
                        >
                          <ProFormSelect
                            width="md"
                            name="faultBitActiveOne"
                            label="故障位激活"
                            options={[
                              { label: 'OFF', value: 0 },
                              { label: '用1个故障位启用', value: 1 },
                            ]}
                            colProps={{ md: 12, xl: 8 }}
                            disabled
                          />
                          <ProFormSelect
                            width="md"
                            name="faultLevelOne"
                            label="故障电平"
                            options={[
                              { label: '低电平', value: 0 },
                              { label: '高电平', value: 1 },
                            ]}
                            colProps={{ md: 12, xl: 8 }}
                            disabled
                          />
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            name="faultPosOne"
                            label="故障位的位置"
                            disabled
                          />
                        </ProFormGroup>
                      </ProFormGroup>
                    </ProFormGroup>
                  </ProFormGroup>
                  <ProFormGroup
                    key="lib4-2"
                    title="编码器2配置"
                    titleStyle={{ backgroundColor: '#f0f8ff' }}
                  >
                    <ProFormGroup>
                      <ProFormSelect
                        width="md"
                        name="isEncoder2Selected"
                        label="编码器2选择"
                        colProps={{ md: 12, xl: 8 }}
                        options={[
                          { label: '编码器2未选择', value: 0 },
                          { label: '编码器2已选择', value: 1 },
                        ]}
                      />
                    </ProFormGroup>
                    <ProFormSelect
                      width="md"
                      name="encoder2Interface"
                      label="编码器接口 P468[1]"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'Terminal', value: 1 },
                        { label: 'D-SUB', value: 2 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormDigit
                      colProps={{ md: 12, xl: 8 }}
                      width="md"
                      key="encoder2Revolution"
                      name="encoder2Revolution"
                      label="编码器转数"
                    />
                    <ProFormDigit
                      colProps={{ md: 12, xl: 8 }}
                      width="md"
                      key="motor2Revolution"
                      name="motor2Revolution"
                      label="电机转数"
                    />
                    <ProFormSelect
                      width="md"
                      name="encoder1InvertSpeed"
                      label="转速实际值取反 P410[1].00"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'FALSE', value: 0 },
                        { label: 'TRUE', value: 1 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoder1InvertPos"
                      label="位置实际值取反 P410[1].01"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'FALSE', value: 0 },
                        { label: 'TRUE', value: 1 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoderNumTwo"
                      label="编码器型号"
                      colProps={{ md: 12, xl: 10 }}
                      debounceTime={1000}
                      request={async (params) => {
                        const result = await getEncoderConfigList({ blurry: params.keyWords });
                        result.data.push({ encoderType: '第三方', id: '第三方' });
                        return result.data.map((item) => {
                          return {
                            key: item.id,
                            label: item.encoderNum,
                            value: item.encoderNum,
                            rowData: item,
                          };
                        });
                      }}
                      fieldProps={{
                        onChange: (val, child) => {
                          console.log(child.rowData, '--rowData.id--');
                          delete child.rowData.id;
                          formRef.current?.setFieldsValue({
                            ...encoderTwoRowNullData,
                            encoderManufacturerTwo: child.rowData.encoderManufacturer,
                            encoderTypeTwo: child.rowData.encoderType,
                            isLinearEncoderTwo: child.rowData.isLinearEncoder,
                            isAbsEncoderTwo: child.rowData.isAbsEncoder,
                            isMultiAbsEncoderTwo: child.rowData.isMultiAbsEncoder,
                            isSsiEncoderTwo: child.rowData.isSsiEncoder,
                            voltageLevelTwo: child.rowData.voltageLevel,
                            remoteSenseTwo: child.rowData.remoteSense,
                            signalTwo: child.rowData.signal,
                            levelTwo: child.rowData.level,
      
                            gxXist1Two: child.rowData.gxXist1,
                            gxXist2Two: child.rowData.gxXist2,
                            singleCircleResTwo: child.rowData.singleCircleRes,
                            multiCircleResTwo: child.rowData.multiCircleRes,
      
                            transCodeTwo: child.rowData.transCode,
                            resolutionTwo: child.rowData.resolution,
                            ssiAbsTwo: child.rowData.ssiAbs,
                            ssiBeforeTwo: child.rowData.ssiBefore,
                            ssiAfterTwo: child.rowData.ssiAfter,
                            baudRateTwo: child.rowData.baudRate,
      
                            faultBitActiveTwo: child.rowData.faultBitActive,
                            faultLevelTwo: child.rowData.faultLevel,
                            faultPosTwo: child.rowData.faultPos,
                          });
                        },
                      }}
                      // rules={[{ required: true, message: '此项是必填项目' }]}
                    />
                    <ProFormGroup
                      key="lib4-1-2"
                      title="编码器2信息"
                      // titleStyle={{ backgroundColor: '#f0f0f0' }}
                      collapsible
                      // defaultCollapsed
                      onCollapse={(collapse) => console.log(collapse)}
                    >
                      <ProFormText
                        width="md"
                        name="encoderManufacturerTwo"
                        label="编码器厂家"
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="encoderTypeTwo"
                        label="编码器类型"
                        options={[
                          { label: '1024HTL A/B R', value: '3001' },
                          { label: '1024HTL A/B', value: '3005' },
                          { label: 'User-defined', value: '9999' },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isLinearEncoderTwo"
                        label="线性编码器 P404[1].00"
                        options={[
                          { label: 'Rotary', value: 0 },
                          { label: 'Linear', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isAbsEncoderTwo"
                        label="绝对值编码器 P404[1].01"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isMultiAbsEncoderTwo"
                        label="多圈绝对值编码器 P404[1].02"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 10 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isSsiEncoderTwo"
                        label="SSI编码器 P404[1].09"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 7 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="voltageLevelTwo"
                        label="电压级24V P404[1].20/P404[1].21"
                        options={[
                          { label: '5V', value: 0 },
                          { label: '13.5-30V', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 11 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="remoteSenseTwo"
                        label="遥感仅对SMC30 P404[1].22"
                        options={[
                          { label: 'Unselect', value: 0 },
                          { label: 'Select', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 10 }}
                        disabled
                      />
      
      
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gxXist1Two"
                        label="编码器精Gx_XIST1 P418[1]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gxXist2Two"
                        label="编码器精Gx_XIST2 P419[1]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="singleCircleResTwo"
                        label="绝对值编码器单圈 P423[1]/P408[1]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="multiCircleResTwo"
                        label="绝对值编码器多圈 P421[1]"
                        disabled
                      />
      
                      <ProFormGroup
                        key="lib4-1-2-1"
                        title="SSI编码器配置"
                        titleStyle={{ color: 'CornflowerBlue', fontSize: '14px' }}
                        collapsible
                        // defaultCollapsed
                      >
                        <ProFormSelect
                          width="md"
                          name="transCodeTwo"
                          label="传输代码 P429[1].00"
                          options={[
                            { label: '格雷码', value: 0 },
                            { label: '二进制代码', value: 1 },
                          ]}
                          colProps={{ md: 12, xl: 8 }}
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiAbsTwo"
                          label="编码器绝对值位 P447[1]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiBeforeTwo"
                          label="编码器之前的位 P446[1]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiAfterTwo"
                          label="编码器之后的位 P448[1]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="baudRateTwo"
                          label="波特率 P427[1]"
                          disabled
                        />
      
                        <ProFormGroup
                          key="lib4-1-1-1-1"
                          title="SSI故障位设置"
                          titleStyle={{ color: 'LightSlateGray', fontSize: '14px' }}
                          collapsible
                          // defaultCollapsed
                        >
                          <ProFormSelect
                            width="md"
                            name="faultBitActiveTwo"
                            label="故障位激活"
                            options={[
                              { label: 'OFF', value: 0 },
                              { label: '用1个故障位启用', value: 1 },
                            ]}
                            colProps={{ md: 12, xl: 8 }}
                            disabled
                          />
                          <ProFormSelect
                            width="md"
                            name="faultLevelTwo"
                            label="故障电平"
                            options={[
                              { label: '低电平', value: 0 },
                              { label: '高电平', value: 1 },
                            ]}
                            colProps={{ md: 12, xl: 8 }}
                            disabled
                          />
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            name="faultPosTwo"
                            label="故障位的位置"
                            disabled
                          />
                        </ProFormGroup>
                      </ProFormGroup>
                    </ProFormGroup>
                  </ProFormGroup>
                </ProFormGroup>
              ];
            } else if (controlMode === 21) {
              return [
                <ProFormGroup
                  key="lib4"
                  title="编码器配置"
                  titleStyle={{ backgroundColor: '#f0f0f0' }}
                  collapsible
                  // defaultCollapsed
                >
                  <ProFormGroup
                    key="lib4-1"
                    title="编码器1配置"
                    titleStyle={{ backgroundColor: '#f0f8ff' }}
                  >
                    <ProFormSelect
                      width="md"
                      name="encoder1Interface"
                      label="编码器接口 P468[0]"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'Terminal', value: 1 },
                        { label: 'D-SUB', value: 2 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoder1InvertSpeed"
                      label="转速实际值取反 P410[0].00"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'FALSE', value: 0 },
                        { label: 'TRUE', value: 1 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoder1InvertPos"
                      label="位置实际值取反 P410[0].01"
                      colProps={{ md: 12, xl: 10 }}
                      options={[
                        { label: 'FALSE', value: 0 },
                        { label: 'TRUE', value: 1 },
                      ]}
                      hidden={props.isG120Eng}
                    />
                    <ProFormSelect
                      width="md"
                      name="encoderNumOne"
                      label="编码器型号"
                      colProps={{ md: 12, xl: 10 }}
                      debounceTime={1000}
                      request={async (params) => {
                        const result = await getEncoderConfigList({ blurry: params.keyWords });
                        result.data.push({ encoderType: '第三方', id: '第三方' });
                        return result.data.map((item) => {
                          return {
                            key: item.id,
                            label: item.encoderNum,
                            value: item.encoderNum,
                            rowData: item,
                          };
                        });
                      }}
                      fieldProps={{
                        onChange: (val, child) => {
                          console.log(child.rowData, '--rowData.id--');
                          delete child.rowData.id;
                          formRef.current?.setFieldsValue({
                            ...encoderOneRowNullData,
                            encoderManufacturerOne: child.rowData.encoderManufacturer,
                            encoderTypeOne: child.rowData.encoderType,
                            isLinearEncoderOne: child.rowData.isLinearEncoder,
                            isAbsEncoderOne: child.rowData.isAbsEncoder,
                            isMultiAbsEncoderOne: child.rowData.isMultiAbsEncoder,
                            isSsiEncoderOne: child.rowData.isSsiEncoder,
                            voltageLevelOne: child.rowData.voltageLevel,
                            remoteSenseOne: child.rowData.remoteSense,
                            signalOne: child.rowData.signal,
                            levelOne: child.rowData.level,
      
                            gxXist1One: child.rowData.gxXist1,
                            gxXist2One: child.rowData.gxXist2,
                            singleCircleResOne: child.rowData.singleCircleRes,
                            multiCircleResOne: child.rowData.multiCircleRes,
      
                            transCodeOne: child.rowData.transCode,
                            resolutionOne: child.rowData.resolution,
                            ssiAbsOne: child.rowData.ssiAbs,
                            ssiBeforeOne: child.rowData.ssiBefore,
                            ssiAfterOne: child.rowData.ssiAfter,
                            baudRateOne: child.rowData.baudRate,
      
                            faultBitActiveOne: child.rowData.faultBitActive,
                            faultLevelOne: child.rowData.faultLevel,
                            faultPosOne: child.rowData.faultPos,
                          });
                        },
                      }}
                      // rules={[{ required: true, message: '此项是必填项目' }]}
                    />
                    <ProFormGroup
                      key="lib4-1-1"
                      title="编码器1信息"
                      // titleStyle={{ backgroundColor: '#f0f0f0' }}
                      collapsible
                      // defaultCollapsed
                      onCollapse={(collapse) => console.log(collapse)}
                    >
                      <ProFormText
                        width="md"
                        name="encoderManufacturerOne"
                        label="编码器厂家"
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="encoderTypeOne"
                        label="编码器类型"
                        colProps={{ md: 12, xl: 8 }}
                        options={[
                          { label: '1024HTL A/B R', value: '3001' },
                          { label: '1024HTL A/B', value: '3005' },
                          { label: 'User-defined', value: '9999' },
                        ]}

                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isLinearEncoderOne"
                        label="线性编码器 P404[0].00"
                        options={[
                          { label: 'Rotary', value: 0 },
                          { label: 'Linear', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isAbsEncoderOne"
                        label="绝对值编码器 P404[0].01"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isMultiAbsEncoderOne"
                        label="多圈绝对值编码器 P404[0].02"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 10 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="isSsiEncoderOne"
                        label="SSI编码器 P404[0].09"
                        options={[
                          { label: '否', value: 0 },
                          { label: '是', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 7 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="voltageLevelOne"
                        label="电压级24V P404[0].20/P404[0].21"
                        options={[
                          { label: '5V', value: 0 },
                          { label: '13.5-30V', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 11 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="remoteSenseOne"
                        label="遥感仅对SMC30 P404[0].22"
                        options={[
                          { label: 'Unselect', value: 0 },
                          { label: 'Select', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 10 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="signalOne"
                        label="信号 P405[0].00"
                        options={[
                          { label: 'Unipolar', value: 0 },
                          { label: 'Bipolar', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
                      <ProFormSelect
                        width="md"
                        name="levelOne"
                        label="电平 P405[0].01"
                        options={[
                          { label: 'HTL', value: 0 },
                          { label: 'TTL', value: 1 },
                        ]}
                        colProps={{ md: 12, xl: 8 }}
                        disabled
                      />
      
      
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gxXist1One"
                        label="编码器精Gx_XIST1 P418[0]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gxXist2One"
                        label="编码器精Gx_XIST2 P419[0]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="singleCircleResOne"
                        label="绝对值编码器单圈 P423[0]/P408[0]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="multiCircleResOne"
                        label="绝对值编码器多圈 P421[0]"
                        disabled
                      />
      
      
                      <ProFormGroup
                        key="lib4-1-1-1"
                        title="SSI编码器配置"
                        titleStyle={{ color: 'CornflowerBlue', fontSize: '14px' }}
                        collapsible
                        // defaultCollapsed
                      >
                        <ProFormSelect
                          width="md"
                          name="transCodeOne"
                          label="传输代码 P429[0].00"
                          options={[
                            { label: '格雷码', value: 0 },
                            { label: '二进制代码', value: 1 },
                          ]}
                          colProps={{ md: 12, xl: 8 }}
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="resolutionOne"
                          label="分辨率 P407[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiAbsOne"
                          label="编码器绝对值位 P447[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiBeforeOne"
                          label="编码器之前的位 P446[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="ssiAfterOne"
                          label="编码器之后的位 P448[0]"
                          disabled
                        />
                        <ProFormDigit
                          width="md"
                          colProps={{ md: 12, xl: 8 }}
                          name="baudRateOne"
                          label="波特率 P427[0]"
                          disabled
                        />
                    
                        <ProFormGroup
                          key="lib4-1-1-1-1"
                          title="SSI故障位设置"
                          titleStyle={{ color: 'LightSlateGray', fontSize: '14px' }}
                          collapsible
                          // defaultCollapsed
                        >
                          <ProFormSelect
                            width="md"
                            name="faultBitActiveOne"
                            label="故障位激活"
                            options={[
                              { label: 'OFF', value: 0 },
                              { label: '用1个故障位启用', value: 1 },
                            ]}
                            colProps={{ md: 12, xl: 8 }}
                            disabled
                          />
                          <ProFormSelect
                            width="md"
                            name="faultLevelOne"
                            label="故障电平"
                            options={[
                              { label: '低电平', value: 0 },
                              { label: '高电平', value: 1 },
                            ]}
                            colProps={{ md: 12, xl: 8 }}
                            disabled
                          />
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            name="faultPosOne"
                            label="故障位的位置"
                            disabled
                          />
                        </ProFormGroup>
                      </ProFormGroup>
                    </ProFormGroup>
                  </ProFormGroup>
                </ProFormGroup>
              ];
            } else { return; }
          }}
        </ProFormDependency>

        <ProFormGroup
          key="lib5"
          title="工艺参数"
          titleStyle={{ backgroundColor: '#f0f0f0' }}
          collapsible
          // defaultCollapsed
        >
          <ProCard
            layout="center"
            hidden={modeHidden}
            tabs={{
              type: 'card',
              tabPosition,
              activeKey: tab,
              items: [
                {
                  label: 'EPOS',
                  key: 'tab1',
                  disabled: tab != 'tab1' && formRef.current?.getFieldValue("controlMode") !== 99,
                  children: [
                    <ProFormGroup key="lib5-1" style={{ marginTop: '20px' }}>
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="lrEncoderAssign"
                        label="定位编码器 P2502"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gearRationMotor"
                        label="电机转数 P2504"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 8 }}
                        name="gearRationLoad"
                        label="负载转数 P2505"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="positionAccuracy"
                        label="10mm对应的LU (EPOS) P2503"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="loadOneTurnDistance"
                        label="负载一圈的距离 [mm]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="luLoopEpos"
                        label="每转LU (EPOS) P2506"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="posSetpointFiltTimeConst"
                        label="位置设定值滤波器时间常数 (EPOS) P2533 [ms]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="kprEpos"
                        label="位置环增益 (EPOS) P2538"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="lrIntegralTime"
                        label="位置环积分时间 (EPOS) P2539"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="coeffVelEpos"
                        label="速度前馈系数 (EPOS) P2534"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="vmaxEpos"
                        label="EPOS 最大速度 P2571 [m/min]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="accmaxEpos"
                        label="EPOS 最大加速度 P2572 [m/s²]"
                        disabled
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="dccmaxEpos"
                        label="EPOS 最大减速度 P2573 [m/s²]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="jerkEpos"
                        label="EPOS 急动限制 P2574 [m/s³]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="jerkActiveEpos"
                        label="EPOS 急动限制激活 P2575"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="lrOutputVelLimit"
                        label="LR 输出速度极限 P2540"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="jog1VelEpos"
                        label="Jog1速度 (EPOS) P2585 [m/min]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="jog2VelEpos"
                        label="Jog2速度 (EPOS) P2586  [m/min]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="softLimitPositive"
                        label="正软限位开关 (EPOS) p2580 [mm]"
                        hidden={props.isG120Eng}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="softLimitNegative"
                        label="负软限位开关 (EPOS) p2581 [mm]"
                        hidden={props.isG120Eng}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="standstillWindow"
                        label="静态窗口 P2542"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="standstillMonitoringTime"
                        label="静态监控时间 P2543 [ms]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 6 }}
                        name="posWindow"
                        label="定位窗口 P2544"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 9 }}
                        name="posMonitoringTime"
                        label="定位监控时间 P2545 [ms]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 9 }}
                        name="dynMonitoringTol"
                        label="动态监控公差 P2546 [LU]"
                      />
                      {props.isG120Eng ? null :
                        <ProFormGroup
                          key="lib5-1-1"
                          title="STOP凸轮"
                          // titleStyle={{ backgroundColor: '#f0f0f0' }}
                        >
                          <ProFormSelect
                            width="md"
                            name="isParaModified"
                            label="需要激活修改参数"
                            options={[
                              { label: 'FALSE', value: 0 },
                              { label: 'TRUE', value: 1 },
                            ]}
                            colProps={{ md: 12, xl: 8 }}
                          />
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            name="camMinus"
                            label="负向 P2569"
                          />
                          <ProFormDigit
                            width="md"
                            colProps={{ md: 12, xl: 8 }}
                            name="camPlus"
                            label="正向 P2570"
                          />
                        </ProFormGroup>
                      }
                    </ProFormGroup>
                  ],
                },
                {
                  label: 'Speed',
                  key: 'tab2',
                  disabled: tab != 'tab2' && tab != 'tab1',
                  children: [
                    <ProFormGroup key="lib5-2" style={{ marginTop: '20px' }}>
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="kpSpeed"
                        label="速度环增益(Speed) P1460"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="tnSpeed"
                        label="速度环积分时间(Speed) P1462"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="tincSpeed"
                        label="RFG上升时间 (Speed) P1120 [s]"
                        hidden={eposFlag}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="tdecSpeed"
                        label="RFG下降时间 (Speed) P1121 [s]"
                        hidden={eposFlag}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="tstartSpeed"
                        label="RFG开始端平滑时间 P1130 [s]"
                        hidden={eposFlag}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="tstopSpeed"
                        label="RFG结束端平滑时间 P1131 [s]"
                        hidden={eposFlag}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="off3TdecSpeed"
                        label="OFF3斜坡下降时间 P1135 [s]"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="accPrectrlScaling"
                        label="加速度前馈定标 P1496"
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="kpAdaptUpper"
                        label="Kp适配速度上限比例系数 P1461 [%]"
                        hidden={props.isG120Eng}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="tnAdaptUpper"
                        label="Tn适配速度上限比例系数 P1463 [%]"
                        hidden={props.isG120Eng}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="adaptSpeedLower"
                        label="适配转速下限 P1464 [rpm]"
                        hidden={props.isG120Eng}
                      />
                      <ProFormDigit
                        width="md"
                        colProps={{ md: 12, xl: 12 }}
                        name="adaptSpeedUpper"
                        label="适配转速上限 P1465 [rpm]"
                        hidden={props.isG120Eng}
                      />
                    </ProFormGroup>
                  ],
                },
              ],
              onChange: (key) => {
                setTab(key);
              },
            }}
          />
        </ProFormGroup>
      </ModalForm>
    </div>
  );
};
const G120LibEngShaftCommon = forwardRef<unknown, FormDialogProps>(G120ShaftEngmodal);

export default G120LibEngShaftCommon;
